package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	open, err := os.Open("strFunc.go")
	if err != nil {
		panic(err)
	}
	printFileContents(open)
}

//Read 文件读入内存
func printFileContents(read io.Reader) {
	scanner := bufio.NewScanner(read)
	for scanner.Scan() {
		fmt.Println(scanner.Text())
	}
}
